package com.com.typhoon.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;
import java.util.Map;

/**
 * @author shuya | dongfeng.zdf@alibaba-inc.com
 * @description
 * @date 2018/10/19 下午2:35
 * @description
 * @modified by
 * @since V2.0.0
 */
@Controller
public class HomeController {


    @GetMapping("/")
    @Secured("ROLE_ADMIN")
    public String home(Map<String, Object> model) {
        model.put("message", "Hello World");
        model.put("title", "Hello Home");
        model.put("date", new Date());
        return "home";
    }

    @GetMapping("/login")
    public String index() {
        return "login";
    }


}
